package cn.starrysky108.simpleerp.core.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonValue;

/**
 * 资源类型枚举
 *
 * @author Carl Lee
 */
public enum FileTypeEnum {
    /**
     * 1-->文档
     */
    DOCUMENT(1, "文档","text  "),
    /**
     * 2-->图片
     */
    IMAGE(2, "图片","image"),
    /**
     * 3-->视频
     */
    VIDEO(3, "视频","video"),
    /**
     * 4-->音频
     */
    AUDIO(4, "音频","audio"),
    /**
     * 5-->其他
     */
    OTHERS(5, "其他","application");

    /**
     * 枚举代码
     */
    @EnumValue
    private final int code;
    /**
     * 序列化返回值
     */
    @JsonValue
    private final String description;
    /**
     * mime代码类型前缀
     */
    private final String mimePrefix;

    FileTypeEnum(int code, String description,String mimePrefix) {
        this.code = code;
        this.description = description;
        this.mimePrefix = mimePrefix;
    }

    public int getCode() {
        return code;
    }

    public String getDescription() {
        return description;
    }

    public String getMimePrefix() {
        return mimePrefix;
    }

    @Override
    public String toString() {
        return "FileTypeEnum{" +
                "code=" + code +
                ", description='" + description + '\'' +
                '}';
    }

}
